//
//  SZNetworkTool+News.m
//  03-仿网易新闻
//
//  Created by ItHeiMa on 2017/1/3.
//  Copyright © 2017年 itHeima. All rights reserved.
//

#import "SZNetworkTool+News.h"
//#import "SZNewsModel.h"

@implementation SZNetworkTool (News)

- (void) requestNewsList: (NSString *) tid competetion: (void(^)(NSArray *newList)) competetion {
    NSString *urlString = [NSString stringWithFormat:@"http://c.m.163.com/nc/article/headline/%@/0-20.html", tid];
    [[SZNetworkTool sharedTool] requestWithURLString:urlString parameters:nil method:@"GET" comepetion:^(id response) {
        //加载失败
        if (response == nil) {
            competetion(nil);
        } else {
//            NSArray *dicArr = response[tid];
//            NSArray *modelArr = [NSArray yy_modelArrayWithClass:[SZNewsModel class] json:dicArr];
//            competetion(modelArr);
        }
    }];
}

- (void) reqeuestNewsDetail: (NSString *) docid competetion: (void(^)(NSDictionary *response)) competetion {
    NSString *urlString = [NSString stringWithFormat:@"http://c.m.163.com/nc/article/%@/full.html", docid];
    [[SZNetworkTool sharedTool] requestWithURLString:urlString parameters:nil method:@"GET" comepetion:^(id responseObject) {
        //加载失败
        if (responseObject == nil) {
            competetion(nil);
        } else {
            competetion(responseObject);
        }
    }];
}

@end
